package com.example.defaultshop;

import android.os.Parcel;
import android.os.Parcelable;

public class Menu implements Parcelable {
	private String name, extra, obs, nrtxt, bon, picture;
	
	private boolean showPicture;
	private int idx, price, minAntal, maxAntal, categoryId;
	
	public Menu(int idx, String name, String extra, String obs, String nrtxt, String bon, int price, int minAntal, int maxAntal, int categoryId, String picture, boolean showPicture) {
		this.idx = idx;
		this.name = name;
		this.extra = extra;
		this.obs = obs;
		this.nrtxt = nrtxt;
		this.bon = bon;
		this.price = price;
		this.minAntal = minAntal;
		this.maxAntal = maxAntal;
		this.categoryId = categoryId;
		this.picture = picture;
		this.showPicture = showPicture;
	}
	
	public Menu() {
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getObs() {
		return obs;
	}

	public void setObs(String obs) {
		this.obs = obs;
	}

	public String getNrtxt() {
		return nrtxt;
	}

	public void setNrtxt(String nrtxt) {
		this.nrtxt = nrtxt;
	}

	public int getIdx() {
		return idx;
	}

	public void setIdx(int idx) {
		this.idx = idx;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public int getMinAntal() {
		return minAntal;
	}

	public void setMinAntal(int minAntal) {
		this.minAntal = minAntal;
	}

	public int getMaxAntal() {
		return maxAntal;
	}

	public void setMaxAntal(int maxAntal) {
		this.maxAntal = maxAntal;
	}

	public String getExtra() {
		return extra;
	}

	public void setExtra(String extra) {
		this.extra = extra;
	}

	public String getBon() {
		return bon;
	}

	public void setBon(String bon) {
		this.bon = bon;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public boolean isShowPicture() {
		return showPicture;
	}

	public void setShowPicture(boolean showPicture) {
		this.showPicture = showPicture;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeInt(idx);
		out.writeString(name);
		out.writeString(extra);
		out.writeString(obs);
		out.writeString(nrtxt);
		out.writeString(bon);
		out.writeInt(price);
		out.writeInt(minAntal);
		out.writeInt(maxAntal);
		out.writeInt(categoryId);
		out.writeString(picture);
		out.writeInt((showPicture ? 1 : 0));
	}
	
	public static final Parcelable.Creator<Menu> CREATOR = new Parcelable.Creator<Menu>() {
		@Override
		public Menu createFromParcel(Parcel in) {
			return new Menu(in);
		}

		@Override
		public Menu[] newArray(int size) {
			return new Menu[size];
		}
	};
	
	private Menu(Parcel in) {
		idx = in.readInt();
		name = in.readString();
		extra = in.readString();
		obs = in.readString();
		nrtxt = in.readString();
		bon = in.readString();
		price = in.readInt();
		minAntal = in.readInt();
		maxAntal = in.readInt();
		categoryId = in.readInt();
		picture = in.readString();
		showPicture = (in.readInt() == 1 ? true : false);
	}
}